home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 001 / menuutils / !Examples / !Help < prev    next >
Text File  |  1993-01-23  |  6KB  |  138 lines

  1.  
  2.  
  3.                        !Examples application                       
  4.   
  5.                       (C) Petrov Software 1992
  6.  
  7.  
  8.  
  9.  
  10.                               Purpose
  11.  
  12. The purpose of this application is to illustrate the use of MenuUtils
  13. module in BASIC programs. When run !Examples starts up several
  14. examples as independent Wimp tasks. Module MenuUtils may be found
  15. inside !Examples directory.
  16.                                 
  17.  
  18.                        Description of examples
  19.  
  20. All examples are contained in directory Examples inside !Examples
  21. application. Their names are "Ex1", "Ex2", ... Each program
  22. illustrates different aspects of using MenuUtils module.
  23.  
  24. All examples are written in BASIC. Functions and procedures common for
  25. all examples are placed in special "Library" file (description of the
  26. file is bellow).
  27.  
  28. After startup all programs place their icons on Iconbar. To see the
  29. corresponding menu click with Menu button over the icon. To quit the
  30. program select "Quit" item.
  31.                                                                  
  32.                                "Ex1"
  33.  
  34. This program creates the simplest menu consisting of a single item
  35. "Quit". After registration as the Wimp task the program calls
  36. MenuUtil_Initialise to register itself as MenuUtils client. Then the
  37. program calls MenuUtil_New to start creation of the menu and then
  38. MenuUtil_Add to add the single menu item. Look how to attach item
  39. handler. When menu creation is finished the program enters Wimp_Poll
  40. loop. Inside the loop the program answers only to three reason codes:
  41. mouse click, menu selection and message (quit message is received when
  42. user selects "Quit" from Task Manager's menu). Mouse click reason code
  43. is returned when user clicks with mouse over the program's iconbar
  44. icon. The program checks if the click is with Menu button and displays
  45. menu on screen using MenuUtil_Show. Menu selection reason code is
  46. returned when user selects from the menu. To find out what is selected
  47. the program calls MenuUtil_Decode. This call returns the pointer to
  48. item handler if the "Quit" item is selected. In this case the program
  49. reads the name of the handler and then calls it.
  50.  
  51.  
  52.                                 "Ex2"
  53.  
  54. This program illustrates the use of dialog boxes. Menu of this program
  55. consists of two items "Info" and "Quit". After initialisation the
  56. program creates a window which will be used as a dialog box. After
  57. "Info" item is created the program calls "MenuUtil_SubMenu" to link it
  58. with the dialog box. An arrow will be displayed to the right of the
  59. item. And if the user moves the mouse pointer over this, then "About
  60. this program" window automatically pops up. If user selects something
  61. from menu with Adjust button then it will be detected by
  62. MenuUtil_Decode and the program calls MenuUtil_Show to reopen menu on
  63. the same place.                           
  64.  
  65.                                 "Ex3"
  66.  
  67. This program illustrates the use of colour setting menu. Main menu
  68. consists of three items "Info", "Colour" and "Quit". The program calls
  69. MenuUtil_ColourMenu to create standard colour setting submenu. And
  70. then MenuUtil_SubMenu to link it with "Colour" item. The program
  71. attaches one common handler to all items of submenu. This handler will
  72. be called when user selects any item in the submenu. The position of
  73. selected item (not the item handle) is taken from the block returned
  74. by MenuUtil_Decode. Then MenuUtil_TickOnly is called to tick selected
  75. item. The program also calls MenuUtil_Colours to change the colours of
  76. "Colour" item as is done in "!FormEd" application.
  77.  
  78.  
  79.                                 "Ex4"
  80.  
  81. This program illustrates the use of writable menu items and also
  82. insertion and deletion of menu items with help of MenuUtils module.
  83. Main menu consists of three items "Info","*Command" and "Quit".
  84. "*Command" item is linked with "Command" submenu which at the
  85. beginning consists of a single item. The program calls
  86. "MenuUtil_Writable" to make this item writable. User can enter RISC OS
  87. command here. If user selects this item then corresponding item
  88. handler will be called. The handler executes the command and also
  89. remembers it by adding an item to the submenu. Now user can repeat the
  90. command by selecting new item. Each new item is linked with "Delete"
  91. submenu what allows to delete not needed items.
  92.  
  93.  
  94.                              "Library"
  95.  
  96. This file contains functions and procedures common to all examples. 
  97.  
  98. PROCinit(task$) registers the program as Wimp task, opens common
  99. templates file and places icon on iconbar.
  100.  
  101. FNwindow(window$) loads window definition from templates file and
  102. creates the window. Function returns the handle of the window.
  103.  
  104. PROCinit("") closes templates file.                               
  105.  
  106. PROCquit calls Wimp_CloseDown and quits the program.
  107.  
  108. PROCmessage calls PROCquit if the message is "quit".
  109.  
  110.  
  111.                                                       
  112. -----------------------------------------------------------------
  113.                      Notes from the author
  114.  
  115.  
  116. MenuUtils is freeware software. Everybody is free to use MenuUtils
  117. module, even in commercial code. In case of commercial use I would
  118. like to know this in advance (I could than provide you with the latest
  119. release). You can always contact me if you found some bug, or when
  120. having other suggestions.
  121.  
  122.          To contact the author of MenuUtils, please write to:
  123.                                       
  124.                                         RUSSIA
  125.                                         115541
  126.                                         Moscow
  127.                                         Kavkazsky boulevard, 29
  128.                                         Bld. 1, Flat 107
  129.                                         Alex Petrov    
  130.  
  131.                          E-mail: APetrov@misis.msk.su              
  132.                                  APetorv@arm.msk.su
  133.  
  134.                          FIDO:   2:5020/104.13
  135.  
  136.                           phone: +7 095 322 2098
  137.                           fax  : +7 095 236 8350
  138.